package Test4;
import Test2.Point;

import java.util.Objects;

public class InheritPoint extends Point{

    public InheritPoint(){
        super(0,0);
    }
    public InheritPoint(int x, int y){
        super(x, y);
    }

    @Override
    public String toString() {
        return "("+this.getX()+","+this.getX()+")";
    }

    @Override
    public boolean equals(Object obj){
        if(obj==null){
            return false;
        }
        if(obj instanceof InheritPoint ){
            InheritPoint prt=(InheritPoint)obj;
            if(this.getX()== prt.getX()&&this.getY()==prt.getY()){
                return true;
            }
        }
        else if(obj instanceof Point ){
            Point prt=(Point)obj;
            if(this.getX()== prt.getX()&&this.getY()==prt.getY()) {
                return true;
            }
        }
        return false;
    }



}
